Skip to content

Conversation

martinxsliu
Copy link

Add a class variable Token.settings which defaults to api_settings. This allows users to define multiple Token classes with different settings, e.g. in cases where we may want to validate against multiple token types.

Copy link
Owner

@eadwinCode eadwinCode left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There are also failing tests

token_type: Optional[str] = None
lifetime: Optional[datetime] = None
lifetime: Optional[timedelta] = None
settings: NinjaJWTSettings = api_settings
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

settings is better off a property than a cls attribute

@property
def ninja_jwt_setting(self) -> NinjaJWTSettings:
    return api_settings

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants